﻿/*  ----------------------------------------------------------------------------
 *  SysServer
 *  ----------------------------------------------------------------------------
 *  File:       Task.cs
 *  Creater:     SEEN\MistSeen
 *  ----------------------------------------------------------------------------
 *  $Date: 2010-09-06 10:36:01 +0000 (Mon, 06 Sep 2010) $
 *  $Rev: 15 $
 *  $Author: ScorDeity $
 *  $URL: http://sysserver.googlecode.com/svn/trunk/src/SysServer/Task.cs $
 *  $Id: Task.cs 15 2010-09-06 10:36:01Z ScorDeity $
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SysServer
{
    public abstract class Task : TEntity, ITask
    {
        private bool _Active=true;

        public bool Active
        {
            get
            {
                return _Active;
            }
            set
            {
                _Active = value;
            }
        }
        
        public Task()
        {
        }

        public abstract void Run(ThreadPool tp);
        public abstract void Done();

        private object _Id;

        public object Id
        {
            get
            {
                return _Id;
            }
            set
            {
                _Id = value;
            }
        }

        private Guid _InnerId;

        internal Guid InnerId
        {
            get
            {
                return _InnerId;
            }
            set
            {
                _InnerId = value;
            }
        }

        public abstract object UserData
        {
            get;
            set;
        }
    }
}